﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ConsoleApplication1.DesignerPatter.Observer
{
    class Boss:Isubject
    {
        string action;
        List<Observer> lst = new List<Observer>();
        public void Attach(Observer obs)
        {
            lst.Add(obs);
        }

        public void DeTach(Observer obs)
        {
            lst.Remove(obs);
        }

        public void Notify()
        {
            foreach (Observer obs in lst)
            {
                obs.Update();
            }
        }

        public string SubjectState
        {
            get { return action; }
            set { this.action = value; }
        }

    }
}
